#include <iostream>
using namespace std;

class student_t {
  private:
    static int m_total; // 静态成员变量
  private:
    const char *m_name;
    int   m_age;
    float m_score;
  public:
    student_t(const char *name, int age, float score);
    void show();
};

// 初始化静态成员变量
int student_t::m_total = 0;

student_t::student_t(const char *name, int age, float score) : m_name(name), m_age(age), m_score(score)
{
    m_total++; // 操作静态成员变量
}
void student_t::show()
{
    cout << m_name << "的年龄是" << m_age << "，成绩是" << m_score << "（当前共有" << m_total << "名学生）" << endl;
}

int main()
{
    // 创建匿名对象
    (new student_t("小明", 15, 90))->show();
    (new student_t("李磊", 16, 80))->show();
    (new student_t("张华", 16, 99))->show();
    (new student_t("王康", 14, 60))->show();

    return 0;
}
